﻿<!--
******************************************************************************************************
//  VoltagePhasorGroupDetailDataTemplate.xaml
//
//  Copyright © 2014, Kevin D. Jones.  All Rights Reserved.
//
//  This file is licensed to you under the Eclipse Public License -v 1.0 (the "License"); you may
//  not use this file except in compliance with the License. You may obtain a copy of the License at:
//
//      http://www.opensource.org/licenses/eclipse-1.0.php
//
//  Unless agreed to in writing, the subject software distributed under the License is distributed on an
//  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
//  License for the specific language governing permissions and limitations.
//
//  Code Modification History:
//  **************************************************************************************************
//  02/01/2014 - Kevin D. Jones
//       Generated original version of source code.
//
//****************************************************************************************************
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:System="clr-namespace:System;assembly=mscorlib"
                xmlns:Synchrophasor="clr-namespace:SynchrophasorAnalytics.Calibration;assembly=SynchrophasorAnalytics">
    <ObjectDataProvider x:Key="CalibrationSettings" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
        <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="Synchrophasor:CalibrationSetting"/>
        </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>
    <DataTemplate x:Key="VoltagePhasorGroupDetailTemplate">
        <StackPanel Orientation="Vertical" >
            <Label Padding="20" Content="Voltage Phasor Group Detail" FontSize="25" Style="{StaticResource SegoeFontStyle}"/>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="5" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="10" />
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="5" />
                    <ColumnDefinition Width="*" MinWidth="150"/>
                </Grid.ColumnDefinitions>
                <Label Grid.Row="0" Grid.Column="1" Content="Internal ID" Style="{StaticResource LabelStyle}"/>
                <Label Grid.Row="2" Grid.Column="1" Content="Number" Style="{StaticResource LabelStyle}"/>
                <Label Grid.Row="4" Grid.Column="1" Content="Name" Style="{StaticResource LabelStyle}"/>
                <Label Grid.Row="6" Grid.Column="1" Content="Acronym" Style="{StaticResource LabelStyle}"/>
                <Label Grid.Row="8" Grid.Column="1" Content="Description" Style="{StaticResource LabelStyle}"/>
                <Label Grid.Row="10" Grid.Column="1" Content="Status Word" Style="{StaticResource LabelStyle}"/>
                <Label Grid.Row="12" Grid.Column="1" Content="Calibration Type" Style="{StaticResource LabelStyle}"/>
                
                <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=InternalId}" Style="{StaticResource TextBoxStyle}" Validation.ErrorTemplate="{StaticResource IntegerValidationTemplate}"/>
                <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Path=Number}" Style="{StaticResource TextBoxStyle}" Validation.ErrorTemplate="{StaticResource IntegerValidationTemplate}"/>
                <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding Path=Name}" Style="{StaticResource TextBoxStyle}"/>
                <TextBox Grid.Row="6" Grid.Column="3" Text="{Binding Path=Acronym}" Style="{StaticResource TextBoxStyle}"/>
                <TextBox Grid.Row="8" Grid.Column="3" Text="{Binding Path=Description}" Style="{StaticResource TextBoxStyle}"/>
                <ComboBox Grid.Row="10" Grid.Column="3" ItemsSource="{Binding Path=StatusWordSelection}" DisplayMemberPath="Description" SelectedValue="{Binding StatusFlag, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}"/>
                <ComboBox Grid.Row="12" Grid.Column="3" ItemsSource="{Binding Source={StaticResource CalibrationSettings}}" SelectedItem="{Binding Path=CalibrationType}" Style="{StaticResource ComboBoxStyle}"/>
                <CheckBox Grid.Row="14" Grid.Column="3" Content="Enabled" IsChecked="{Binding Path=IsEnabled}" Style="{StaticResource CheckBoxStyle}"/>
                <CheckBox Grid.Row="16" Grid.Column="3" Content="Use Status Flags For Removing Bad Measurements" IsChecked="{Binding Path=UseStatusFlagsForRemovingMeasurements}" Style="{StaticResource CheckBoxStyle}"/>
                
                <TabControl Grid.Row="18" Grid.RowSpan="10" Grid.Column="1" Grid.ColumnSpan="3">
                    <!--<TabItem Header="Positive Sequence" IsEnabled="{Binding Path=IsPositiveSequence}" MinWidth="130">-->
                    <TabItem Header="Positive Sequence" MinWidth="130">
                            <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition Width="*" MinWidth="150"/>
                            </Grid.ColumnDefinitions>
                            <Label Grid.Row="0" Grid.Column="1" Content="Magnitude Measurement Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="2" Grid.Column="1" Content="Angle Measurement Key" Style="{StaticResource LabelStyle}"/>
                            
                            <Label Grid.Row="4" Grid.Column="1" Content="Variance" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="6" Grid.Column="1" Content="RCF" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="8" Grid.Column="1" Content="PACF" Style="{StaticResource LabelStyle}"/>
                            
                            <Label Grid.Row="12" Grid.Column="1" Content="Magnitude Estimate Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="14" Grid.Column="1" Content="Angle Estimate Key" Style="{StaticResource LabelStyle}"/>

                            <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=PositiveSequenceMagnitudeMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Path=PositiveSequenceAngleMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>
                            
                            <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding Path=PositiveSequenceVariance}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="6" Grid.Column="3" Text="{Binding Path=PositiveSequenceRcf}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="8" Grid.Column="3" Text="{Binding Path=PositiveSequencePacf}" Style="{StaticResource TextBoxStyle}"/>
                            <CheckBox Grid.Row="10" Grid.Column="3" Content="Measurement Should Be Calibrated" IsChecked="{Binding Path=PositiveSequenceMeasurementShouldBeCalibrated}" Style="{StaticResource CheckBoxStyle}"/>
                            
                            <TextBox Grid.Row="12" Grid.Column="3" Text="{Binding Path=PositiveSequenceMagnitudeEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="14" Grid.Column="3" Text="{Binding Path=PositiveSequenceAngleEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="A Phase" IsEnabled="{Binding Path=IsThreePhase}" MinWidth="130">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition Width="*" MinWidth="150"/>
                            </Grid.ColumnDefinitions>
                            <Label Grid.Row="0" Grid.Column="1" Content="Magnitude Measurement Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="2" Grid.Column="1" Content="Angle Measurement Key" Style="{StaticResource LabelStyle}"/>

                            <Label Grid.Row="4" Grid.Column="1" Content="Variance" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="6" Grid.Column="1" Content="RCF" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="8" Grid.Column="1" Content="PACF" Style="{StaticResource LabelStyle}"/>

                            <Label Grid.Row="12" Grid.Column="1" Content="Magnitude Estimate Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="14" Grid.Column="1" Content="Angle Estimate Key" Style="{StaticResource LabelStyle}"/>

                            <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=PhaseAMagnitudeMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Path=PhaseAAngleMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>

                            <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding Path=PhaseAVariance}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="6" Grid.Column="3" Text="{Binding Path=PhaseARcf}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="8" Grid.Column="3" Text="{Binding Path=PhaseAPacf}" Style="{StaticResource TextBoxStyle}"/>
                            <CheckBox Grid.Row="10" Grid.Column="3" Content="Measurement Should Be Calibrated" IsChecked="{Binding Path=PhaseAMeasurementShouldBeCalibrated}" Style="{StaticResource CheckBoxStyle}"/>

                            <TextBox Grid.Row="12" Grid.Column="3" Text="{Binding Path=PhaseAMagnitudeEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="14" Grid.Column="3" Text="{Binding Path=PhaseAAngleEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="B Phase" IsEnabled="{Binding Path=IsThreePhase}" MinWidth="130">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition Width="*" MinWidth="150"/>
                            </Grid.ColumnDefinitions>
                            <Label Grid.Row="0" Grid.Column="1" Content="Magnitude Measurement Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="2" Grid.Column="1" Content="Angle Measurement Key" Style="{StaticResource LabelStyle}"/>

                            <Label Grid.Row="4" Grid.Column="1" Content="Variance" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="6" Grid.Column="1" Content="RCF" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="8" Grid.Column="1" Content="PACF" Style="{StaticResource LabelStyle}"/>

                            <Label Grid.Row="12" Grid.Column="1" Content="Magnitude Estimate Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="14" Grid.Column="1" Content="Angle Estimate Key" Style="{StaticResource LabelStyle}"/>

                            <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=PhaseBMagnitudeMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Path=PhaseBAngleMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>

                            <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding Path=PhaseBVariance}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="6" Grid.Column="3" Text="{Binding Path=PhaseBRcf}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="8" Grid.Column="3" Text="{Binding Path=PhaseBPacf}" Style="{StaticResource TextBoxStyle}"/>
                            <CheckBox Grid.Row="10" Grid.Column="3" Content="Measurement Should Be Calibrated" IsChecked="{Binding Path=PhaseBMeasurementShouldBeCalibrated}" Style="{StaticResource CheckBoxStyle}"/>

                            <TextBox Grid.Row="12" Grid.Column="3" Text="{Binding Path=PhaseBMagnitudeEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="14" Grid.Column="3" Text="{Binding Path=PhaseBAngleEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                        </Grid>
                    </TabItem>
                    <TabItem Header="C Phase" IsEnabled="{Binding Path=IsThreePhase}" MinWidth="130">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition Width="*" MinWidth="150"/>
                            </Grid.ColumnDefinitions>
                            <Label Grid.Row="0" Grid.Column="1" Content="Magnitude Measurement Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="2" Grid.Column="1" Content="Angle Measurement Key" Style="{StaticResource LabelStyle}"/>

                            <Label Grid.Row="4" Grid.Column="1" Content="Variance" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="6" Grid.Column="1" Content="RCF" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="8" Grid.Column="1" Content="PACF" Style="{StaticResource LabelStyle}"/>

                            <Label Grid.Row="12" Grid.Column="1" Content="Magnitude Estimate Key" Style="{StaticResource LabelStyle}"/>
                            <Label Grid.Row="14" Grid.Column="1" Content="Angle Estimate Key" Style="{StaticResource LabelStyle}"/>

                            <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=PhaseCMagnitudeMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Path=PhaseCAngleMeasurementKey}" Style="{StaticResource TextBoxStyle}"/>

                            <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding Path=PhaseCVariance}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="6" Grid.Column="3" Text="{Binding Path=PhaseCRcf}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="8" Grid.Column="3" Text="{Binding Path=PhaseCPacf}" Style="{StaticResource TextBoxStyle}"/>
                            <CheckBox Grid.Row="10" Grid.Column="3" Content="Measurement Should Be Calibrated" IsChecked="{Binding Path=PhaseCMeasurementShouldBeCalibrated}" Style="{StaticResource CheckBoxStyle}"/>

                            <TextBox Grid.Row="12" Grid.Column="3" Text="{Binding Path=PhaseCMagnitudeEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Grid.Row="14" Grid.Column="3" Text="{Binding Path=PhaseCAngleEstimateKey}" Style="{StaticResource TextBoxStyle}"/>
                        </Grid>
                    </TabItem>
                </TabControl>
            </Grid>
        </StackPanel>
    </DataTemplate>
</ResourceDictionary>